<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .n1 {
            width: 400px;
            height: 400px;
            background-color: blue;
            margin-top: 50px;
            /* 加边框 */
            border-top: 1px solid transparent;
        }

        .n2 {
            width: 200px;
            height: 200px;
            background-color: blueviolet;
            margin-top: 100px;
        }
    </style>
</head>

<body>
    <div class="n1">
        <div class="n2"></div>
    </div>

</body>

</html>